package com.component.swing.pannel;

import javax.annotation.PostConstruct;
import javax.swing.JPanel;
import javax.swing.JButton;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.component.swing.listener.MouseListener;
import com.internal.system.System;

import java.awt.GridLayout;

@Component
public class DockPannel extends JPanel {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * Create the panel.
	 */
	
	@Autowired private MouseListener mouse;
	@Autowired private System system;
	
	private JButton start;
	private JButton stop;
	
	public DockPannel() {
		setLayout(new GridLayout(5, 1, -5, -5));
		
		start = new JButton("Start");
		add(start);
		
		stop = new JButton("Stop");
		add(stop);
		
		JButton button_1 = new JButton("New button");
		add(button_1);
		
		JButton button_2 = new JButton("New button");
		add(button_2);
		
		JButton button_3 = new JButton("New button");
		add(button_3);

	}
	
	@PostConstruct
	public void setting(){
		start.addMouseListener(mouse);
		stop.addMouseListener(mouse);
		start.setName("Start");
		stop.setName("Stop");
		
		system.add(start.getName(), start);
		system.add(stop.getName(), stop);
//		component = new java.util.HashMap<String, Object>();
//		component.put("frame", this);
//		component.put("area", area);
//		mouse.setComponent(component);
//		mouse.setPath(path);
//		start.addMouseListener(mouse);
//		stop.addMouseListener(mouse);
	}

}
